package com.admin.controller;

import com.common.domain.entity.Goods;
import com.common.domain.entity.Point;
import com.common.domain.entity.ResponseResult;
import com.common.service.GoodsService;
import org.aspectj.lang.annotation.After;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.*;

/**
 * @author
 * @Date 2023/10/29 13:28
 **/
@RestController
@RequestMapping("system/goods")
public class GoodsController {
    @Autowired
    private GoodsService goodsService;

    @GetMapping("list")
    public ResponseResult allGoodsList(Integer pageNum, Integer pageSize, String goodsName){
        return goodsService.allGoodsList(pageNum,
                pageSize,
                goodsName);
    }

    @PostMapping("/insertGoods")
    public ResponseResult insertGoods(@RequestBody Goods goods){
        return goodsService.insertGoods(goods);
    }

    @DeleteMapping("{ids}")
    public ResponseResult deleteGoods(@PathVariable String ids){
        return goodsService.deleteGoods(ids);
    }
    @PutMapping
    public ResponseResult updateGoods(@RequestBody Goods goods){
        return goodsService.updateGoods(goods);
    }
}
